package cn.com.chengmandian.core.common.enums;

public enum ClientsEnum {
    OPS_ADMIN("ops_admin", "1YKIDpy4YXojpOdG4iWqhsXK7OaOyTZ6", 30, "authentication", "ops", true), // 运营端PC
    OPS_APP("ops_app", "bL0snmI0BTLU351HydbAiUMDxV5QwVhg", 30, "authentication", "ops", true), // 运营端APP
    MERCHANT_ADMIN("merchant_admin", "wgiHtk5n1cPwHJjGdQrplyDt06fK9YRT", 30, "authentication", "merchant", true), // 商户端PC
    MALL_ADMIN_WEB("mall_admin_web", "KtRk&zkFtG$CG1A2qe@OUvYMWhNC*NZqx2w6Ew$iwpNvGi2Ry&SlYSxVs4wrbJVu", 30, "authorization", "sys", true), // C端商城后台
    MALL_MEMBER_MINI("mall_member_mini", "Kv$0gkMbR$VCtYp%PGmBsV1SUC&$ls8Q6oTYi1j71OCtTeiO3SW2jSSYIvZJhBl6", 30, "authorization", "member", true), // C端小程序
    MALL_OPS_MINI("mall_ops_mini", "GTAk&zkFtG$CG12904@OUvYMWhNC*NZqx2w6Ew$iwpNvGi2Ry&SlYSxVs4wrbJVo", 30, "authorization", "ops", true), // C端运维小程序
    IOT_ADMIN("iot_admin", "B8wQ3juj92C5yr9UuZo8q7iyLAh5fAoQ", 30, "authentication", "sys", true), // C端运维小程序
    // ====== 电单车系统 ======
    BIKE_AGENT_WEB("bike_agent_web", "npiRnwaVzNC7yE02BOUIBSJrMgSJXEiU", 30, "authentication", "bikeAgent", true),// 电单车代理web端
    BIKE_ADMIN_WEB("bike_admin_web", "0C1qSjBssJS4XKbTM4ttIy4AXAjS7T7F", 30, "authentication", "bikeAdmin", true), // 电单车代理管理端
    BIKE_MEMBER_MINI("bike_member_mini", "", 365, "authentication", "bikeUser", true), // 电单车用户端小程序
    BIKE_OPS_APP("bike_ops_app", "fNXlPzzsHIieFV5aMi4Bb929UJHv31UD", 30, "authentication", "bikeOps", false), // 电单车运维端
    BIKE_BRAND_WEB("bike_brand_web", "Rd6brnmwWLId9BkyAxR2T9oGTfBq4scV", 3, "authentication", "bikeBrand", true), // 电单车品牌端
    BIKE_PRODUCE_APP("bike_produce_app", "6y3TwaTfroyeCFjhUMzuMItCH83JIlo7", 7, "authentication", "bikeProduce", true), // 电单车品牌端
    // ====== 电单车系统 ======
    ERP_WEB("erp_web", "x7CqpEpZKkzqt1AeDkNF3WvRhIK3Jmr4", 3, "authorization", "erpSys", true), // ERP的web端
    ERP_MOBILE("erp_mobile", "ii5SZ1lv6sMapL270W8wLybATHBTLnlA", 3, "authorization", "erpSys", true), // ERP的mobile端
    ERP_USER_BUSINESS("erp_user_business", "cV6Q1WEl5owaL2pDAKCNxpbgoKjB93sQ", 30, "authorization", "erpUserBusiness", true), // ERP的客户运维端
    CCS_ADMIN_WEB("ccs_admin_web", "ChKh3pKYgx0vaejVfNYbT3qDsDIV60cQ", 3, "authorization", "ccsAdmin", true), // 客服系统管理Web端
    CCS_USER_WEB("ccs_user_web", "3TaELkd5AzgIg5g6bwhLtxUk9HSzSFpU", 7,  "authorization", "ccsUser", true), // 客服系统用户Web端
    MOS_ADMIN_WEB("mos_admin_web", "ipz9GspOHp1RbkNrJVAMGXDXtze7rGnjS53iRoiYCte3OulWkyWFMkY6EyHNeerH", 30,  "authorization", "sys", true), // 新版C端运营端
    MOS_MERCHANT_ADMIN_WEB("mos_merchant_admin_web", "XWHEmeNQ1wr4F8D8A2s7IXY1EgIwLv8dihsmGTFGxvt5VIvuCyHKWVLFIokuUURO", 7,  "authorization", "merchant", true), // 新版C端合作商端
    MOS_MERCHANT_USER_MINI("mos_merchant_user_mini", "EMhhdojZtZXhr2ZaJ7X8OvGXSFUlaNvIbHni106acARUeGFWR2F4brqh5Uu7chkW", 7,  "authorization", "merchantUser", true), // 合作商用户端
    BSS_ADMIN_WEB("bss_admin_web", "qgPvkBDUsqKgziPBCwWLskIB02nQFO4MBvk1pI0sSN6C1fZtzCmkzmhRhb0Elxui", 30,  "authorization", "bssAdmin", true), // 电单车监管管理端
    BSS_CITY_WEB("bss_city_web", "eogQlgQ2xq2evsR4AQpE4Xam23ROuZUPUkis43Q6BnYUDlrIF44mNsM0Xrz0eyfW", 7,  "authorization", "bssCity", true), // 电单车监管城市监管端
    BSS_PATROL_MINI("bss_patrol_mini", "eogQlgQ2xq2evsR4AQpE4Xam23ROuZUPUkis43Q6BnYUDlrIF44mNsM0Xrz0eyfW", 7,  "authorization", "bssCity", true), // 电单车监管巡检小程序
    BSS_DATA_WEB("bss_data_web", "3HL4GgoSBL4zYEyDOXtk4bwTW6ueqOvBcaJgmHe1L43U0ztEgC7fklpjV20LT9Sm", 7,  "authorization", "bssBusiness", true); // 电单车监管数据平台端

    private String code;

    private String secret; // 令牌密钥

    private Integer expireDay; // 有效期

    private String headerName; // header名称

    private String userType; // 用户类型

    private boolean repeatLogin; // 用户类型

    public String getCode() { return code; }

    public String getSecret() { return secret; }

    public Integer getExpireDay() { return expireDay; }

    public String getHeaderName() { return headerName; }

    public String getUserType() { return userType; }

    public boolean getRepeatLogin() {
        return repeatLogin;
    }

    ClientsEnum(String code, String secret, Integer expireDay, String headerName, String userType, boolean repeatLogin) {
        this.code = code;
        this.secret = secret;
        this.expireDay = expireDay;
        this.headerName = headerName;
        this.userType = userType;
        this.repeatLogin = repeatLogin;
    }

    public static ClientsEnum codeOf(String code) {
        for(ClientsEnum clientsEnum : values()){
            if (code.equals(clientsEnum.getCode())) {
                return clientsEnum;
            }
        }
        return null;
    }
}
